//
//  HeaderCollectionViewCell.m
//  ZhiBoYuan
//
//  Created by coder_di on 2018/5/7.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "HeaderCollectionViewCell.h"
#import "SCChart.h"

@implementation HeaderCollectionViewCell

{
    SCPieChart *chartView;
}

-(void)setNumStr:(long )numStr{
    
    if (chartView) {
        [chartView removeFromSuperview];
        chartView = nil;
    }
    NSArray *items = @[[SCPieChartDataItem dataItemWithValue:100 - numStr color:[UIColor orangeColor] description:@""],
                       [SCPieChartDataItem dataItemWithValue:numStr color:ZhuTiColor description:@""],
                       ];
    chartView = [[SCPieChart alloc] initWithFrame:CGRectMake((ScreenWidth-150 * KscreenWidth)/2, 70 * KscreenHeight , 150.0 * KscreenWidth, 150.0 * KscreenHeight) items:items];
    
    chartView.descriptionTextColor = [UIColor clearColor];
    chartView.descriptionTextFont  = [UIFont fontWithName:@"Avenir-Medium" size:12.0];
    [chartView strokeChart];
    [self.contentView addSubview:chartView];
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {


        UIImageView *ImageVC = [[UIImageView alloc]initWithFrame:CGRectMake(ScreenWidth - 168 * KscreenWidth, 20 * KscreenHeight , 168 * KscreenWidth, 48 * KscreenHeight)];
        ImageVC.image = [UIImage imageNamed:@"统计"];
        [self.contentView addSubview:ImageVC];


        
    }
    return self;
}


@end
